import Axios from '../libs/api.request'

/**
 * 报名参加
 */
export const apply = (params) => {
  return Axios.request({
    url: 'Player/apply',
    method: 'post',
    data: params
  })
}

/**
 * 获取选手
 */
export const getPlayers = (params) => {
  return Axios.request({
    url: 'Player/getPlayers',
    method: 'get',
    params: params
  })
}
/**
 * 获取结果
 */
export const getResultPlayers = (params) => {
  return Axios.request({
    url: 'Player/getResultPlayers',
    method: 'get',
    params: params
  })
}

/**
 * 判断是否已经参加了
 */
export const hasJoin = (id) => {
  return Axios.request({
    url: 'Player/hasJoin',
    method: 'get',
    params: {id:id}
  })
}

/**
 * 根据ID获取选手
 */
export const getPlayerById = (id,needRank=0) => {
  return Axios.request({
    url: 'Player/getPlayerById',
    method: 'get',
    params: {id:id,needRank:needRank}
  })
}
/**
 * 投票
 */
export const vote = (pid,aid) => {
  return Axios.request({
    url: 'Player/vote',
    method: 'get',
    params: {pid:pid,aid:aid}
  })
}

/**
 * 获取我的数据
 */
export const getMyData = (aid) => {
  return Axios.request({
    url: 'Player/getMyData',
    method: 'get',
    params:{aid:aid}
  })
}
/**
 * 获取礼物数据
 */
export const getGiftList = (aid,pid,page,page_size) => {
  return Axios.request({
    url: 'Player/getGiftList',
    method: 'get',
    params:{aid:aid,id:pid,page:page,page_size:page_size}
  })
}


